home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 160 - Disc 2 / MF_UK_160_2.iso / pc / DiscContent / Trials / oxygen / samples / debugger / Numeric calculations / sample1.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2005-07-21  |  1.2 KB  |  33 lines

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--    Category:     Numeric calculations
  3.     Sample from Zvon XSLT tutorial (www.zvon.org)  
  4.     Description:    Functions ceilng(), floor() and round() transform floating point numbers into integers in the specified way. -->
  5. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  6.     <xsl:template match="/">
  7.         <TABLE border="1">
  8.             <TR>
  9.                 <TH>number</TH>
  10.                 <TH>floor</TH>
  11.                 <TH>ceiling</TH>
  12.                 <TH>round</TH>
  13.             </TR>
  14.             <xsl:for-each select="//number">
  15.                 <TR>
  16.                     <TD>
  17.                         <xsl:value-of select="."/>
  18.                     </TD>
  19.                     <TD>
  20.                         <xsl:value-of select="floor(.)"/>
  21.                     </TD>
  22.                     <TD>
  23.                         <xsl:value-of select="ceiling(.)"/>
  24.                     </TD>
  25.                     <TD>
  26.                         <xsl:value-of select="round(.)"/>
  27.                     </TD>
  28.                 </TR>
  29.             </xsl:for-each>
  30.         </TABLE>
  31.     </xsl:template>
  32. </xsl:stylesheet>
  33.